package com.xfcy.blog.dto;

import com.xfcy.blog.valid.AddGroup;
import com.xfcy.blog.valid.ListValue;
import com.xfcy.blog.valid.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * @author 晓风残月Lx
 * @date 2023/5/27 12:52
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PhotoAlbumDTO {

    @NotNull(message = "修改必须指定id", groups = UpdateGroup.class)
    @Null(message = "新增不能指定id", groups = {AddGroup.class})
    private Integer id;

    @NotBlank(message = "相册封面不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String cover;

    @NotBlank(message = "相册描述不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String info;

    @NotBlank(message = "相册名不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String name;

    @ListValue(vals = {0,1}, groups = {UpdateGroup.class, AddGroup.class})
    private Integer status;
}
